package com.itheima.io1.mytest2;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author zhangbaiyan
 * @date 2024-09-22 13:57
 * @description:    字符打印流
 *
 * @version:
 */
public class test3 {

    public static void main(String[] args) throws IOException {
        //1.创建字打印流的对象
        PrintWriter pw = new PrintWriter(new FileWriter("pw.txt"), true);
        //2.写出数据
        pw.println("hello world");
        pw.print(true);
        pw.println();
        pw.printf("%s", "world");
        pw.close();
    }
}
